<template>
    <div class="test-root">
        <img :src="zuanjiauten.img" style="width: 100%;" alt="">
        <div class="test">
            <div class="name">
                <p style="font-size: 24px;font-weight: bold;">{{ zuanjiauten.name }}</p>
                <p style="color: rgba(153, 153, 153, 1);font-size: 14px;margin-left: 15px;">{{ zuanjiauten.phone }}</p>
            </div>
            <div class="tag">
                <div v-for="item, index in zuanjiauten.tag" class="tag_box">{{ item }}</div>
            </div>
            <div class="text">
                <p>{{ zuanjiauten.text }}</p>
            </div>
        </div>
        <div>
            <van-button class="smit" @click="toqrcode">立即预约</van-button>
        </div>
        <div class="more">
            <div style="font-size: 18px;font-weight: bold;">更多专家</div>
            <div class="cell">
                <div class="cell_box" v-for="item, index in column" @click="selectzuanjia(index)">
                    <img :src="item.img_1" style="width: 100%;" alt="">
                    <div>
                        <p style="font-size: 16px;font-weight: bold;margin-top: 2px;">{{ item.name }}</p>
                        <p style="font-size: 8px;color: rgba(153, 153, 153, 1);margin-top: 5px;">{{ item.phone }}</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { useRouter } from 'vue-router';

import image1 from '@/assets/images/1.png';
import image2 from '@/assets/images/1_1.png';
import image3 from '@/assets/images/2.png';
import image4 from '@/assets/images/2_1.png';
const router = useRouter();
const zuanjiauten = ref<any>({
    name: '毛晶晶',
    phone: '13566634236',
    tag: ['专业', '知性', '时尚'],
    text: '擅长搭配，对服装搭配色彩搭配有较强的控制能力，具有对多种服装风格进行搭配的表现力，资深商务场景造型专家！',
    img: image1,
    img_1: image2,
    type: 0,
})

const column = ref<any[]>([
    {
        name: '范丽文',
        phone: '13967876896',
        tag: ['专业', '成熟', '时尚'],
        text: '擅长搭配，有很好的审美认知，参加过国际造型师 Jason.L的时装设计，资深商务场景造型专家！',
        img: image3,
        img_1: image4,
        type: 1,
    },
])
const type = ref<any>(1)

const toqrcode = () => {
    router.push( {name: 'qrcode', params: { id: zuanjiauten.value.type }})
}

const selectzuanjia = (index: any) => {
    console.log(index)
    const item = zuanjiauten.value
    zuanjiauten.value = column.value[index]
    if (column.value.length == 1) {
        column.value = []
    } else {
        column.value = column.value.splice(index, 1)
    }
    column.value.push(item)
}
</script>
<style lang="scss" scoped>
.test-root {
    height: calc(100vh - 32px);
    font-size: 24px;
    margin: 16px;
    background: rgba(245, 245, 245, 1);
}

.test {
    background: white;
    margin: 16px;
    padding: 12px 11px;
    border-radius: 8px;
    overflow: hidden;
}

.tag {
    display: flex;
    align-items: center;
    margin-top: 11px;
}

.tag_box {
    font-size: 18px;
    line-height: 26px;
    width: 60px;
    border-radius: 15px;
    border: 1px solid #333;
    overflow: hidden;
    margin-right: 10px;
    text-align: center;
}

.cell_box {
    background: white;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0px 2px 4px 0px rgba(232, 232, 232, 0.29);
    width: 180px;
    height: 280px;
    padding: 5px;
    margin-right: 10px;
}

.name {
    width: 100%;
    display: flex;
    align-items: flex-end;
}

.text {
    margin-top: 11px;
    margin-bottom: 30px;
    color: rgba(153, 153, 153, 1);
    font-size: 20px;
}

.smit {
    margin: 16px;
    width: calc(100% - 32px);
    font-size: 30px;
    color: white;
    background: #B59474;
    border: 0;
}

.more {
    margin: 16px;

}

.cell {
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
</style>